﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shop.Home.Services
{
    /// <summary>
    /// 购物车业务逻辑层
    /// </summary>
    public class ShopCarAccess
    {
        Shop.Home.Repositories.ShopCarAccess dal = new Repositories.ShopCarAccess();
        /// <summary>
        /// 加入购物车
        /// </summary>
        /// <param name="bcinfo"></param>
        /// <returns></returns>
        public object AddShopCar(Models.BuyCar bcinfo)
        {
            return dal.AddShopCar(bcinfo);
        }
        /// <summary>
        /// 获取购物车信息
        /// </summary>
        /// <param name="UID"></param>
        /// <returns></returns>
        public IList<Models.AnyBuyCar> GetBCInfo(int UID)
        {
            return dal.GetBCInfo(UID);
        }
        /// <summary>
        /// 删除购物车里的商品
        /// </summary>
        /// <param name="BCID"></param>
        /// <returns></returns>
        public int DelShopCar(int BCID)
        {
            return dal.DelShopCar(BCID);
        }
        /// <summary>
        /// 删除当前用户购物车里所有的东西
        /// </summary>
        /// <param name="UID"></param>
        /// <returns></returns>
        public int DelAllShopCar(int UID)
        {
            return dal.DelAllShopCar(UID);
        }
        /// <summary>
        /// 根据ID获取购物车信息
        /// </summary>
        /// <param name="BCID"></param>
        /// <returns></returns>
        public Models.BuyCar GetBCInfoByID(int BCID)
        {
            return dal.GetBCInfoByID(BCID);
        }
    }
}
